% 第一章
\chapter{What are we going to learn?}
\section{A system of linear equations}

A system of linear equations is defined as follows: 
\begin{align*}
    a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n &= b_1 \\
    a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n &= b_2 \\
    \vdots \\
    a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n &= b_m
\end{align*}
That's means there are $m$ equations and $n$ variables. In general, $m$ and $n$ can be large in \textbf{Linear Algebra}

\section{Solving a system of linear equations}
\begin{itemize}
    \item Does it have solution? -- Approximate Solution
    \item Does it have unique solution?
    \item How to find the solution?
    \item Derterminants -- Beyond 3 × 3
    % Derterminants 行列式
\end{itemize}

\section{Linear System}

We use \textbf{a system of linear equations to describe a linear system. }
\subsection{What is system?}
\begin{itemize}
    \item Funtion, tranformation, operator
    \item A system has \textbf{input} and \textbf{output}
    \item Can have multipule inputs and outputs
\end{itemize}

\subsection{What is linear system}
Linear system have two properties
\begin{enumerate}
    \item Persevering \textbf{Multipulication}
    \item Persevering \textbf{Addition}
\end{enumerate}

\subsection{Linear System v.s. System of Linear Equations}

A \textbf{system of linear equations} is equal \textbf{linear system}, and vice versa. 
That's is easy to prove. Check the \textbf{prove} in the Bilibili.com.

\section{Applications}
Most system are (assumed to be) linear. 

% 第二章
\chapter{Vectors, Matrices, and their Products}
\section{Vectors}
\subsection{Vectors}
A vector $\mathbf{v}$ is a set of numbers. 
\begin{itemize}
    \item Column vector
    \begin{align*}
        \mathbf{v} = 
        \begin{bmatrix}
            1 \\
            2 \\
            3 \\
        \end{bmatrix}
    \end{align*}
    \item Row vector
    \begin{align*}
        \mathbf{v} = 
        \begin{bmatrix}
            1 & 2 & 3\\
        \end{bmatrix}
    \end{align*}
\end{itemize}

In this note, the term \textbf{vector} refers to a \textbf{Column Vector} unless being explicitly mentioned. 

\subsection{Components}
Components means the entries of a vector. And the i-th component of vector $\mathbf{v}$ refers to $v_i$. 

\subsection{Scalar Multiplication}
For example, vector $\mathbf{v}$ can be times by a scalar $c$.  
\begin{align*}
    v = 
    \begin{bmatrix}
        v_1 \\
        v_2 \\
    \end{bmatrix}
    \qquad
    \rightarrow
    \qquad
    cv = 
    \begin{bmatrix}
        cv_1 \\
        cv_2 \\
    \end{bmatrix}
\end{align*}

\subsection{Vector Addition}
There two vectors, $\mathbf{a}$ and $\mathbf{b}$, we can add them to one vector. 
\begin{align*}
    a = 
    \begin{bmatrix}
        a_1 \\
        a_2 \\
    \end{bmatrix}
    \quad
    + 
    \quad 
    b = 
    \begin{bmatrix}
        b_1 \\
        b_2 \\
    \end{bmatrix}
    \quad
    =
    \quad
    a + b = 
    \begin{bmatrix}
        a_1 + b_1 \\
        a_2 + b_2 \\
    \end{bmatrix}
\end{align*}

\subsection{Special Vectors}
\begin{itemize}
    \item Zero vector $mathbf{0}$
    \begin{align*}
        \mathbf{0} = 
        \begin{bmatrix}
            0 \\
            \vdots \\
            0\\
        \end{bmatrix}
        Can be any size. 
    \end{align*}
    \item Standard vectors: 
    If the vector subscript is $n$, the component of index $n$ will be equal to $1$ and others components are equal to $0$.
    \begin{align*}
        e_1 = 
        \begin{bmatrix}
            1 \\
            0 \\
            \vdots \\
            0
        \end{bmatrix}
        ,
        e_2 = 
        \begin{bmatrix}
            0 \\
            1 \\
            \vdots \\
            0 \\
        \end{bmatrix}
        , 
        \cdots
        , 
        e_n = 
        \begin{bmatrix}
            0 \\
            0 \\
            \vdots \\
            1 \\
        \end{bmatrix}
    \end{align*}
\end{itemize}

\subsection{Vector Set}
A vector set can contain infinite elements
\begin{itemize}
    \item $\mathcal{R}^n$: the set of all vectors with $n$. 
    
    Such as, $\mathcal{R}^2$, means a set of points in two dimensions
\end{itemize}

\section{Matrix}
Matrix is a set of vectors which have same entries. If the matrix has $m$ rows and $n$ columns, we say the size of the matirx is $m$ by $n$, written $m \times n$. If a matrix, and the number of rows is equal to the number of columns(this to $m=n$), we call the matrix is \textbf{square}. We use $\mathcal{M}_{m \times n}$ to denote the set that contains all matrices whose size is $m \times n$. For example, 
\begin{align*}
    \begin{bmatrix}
        1 & 2 & 3 \\
        4 & 5 & 6 \\
    \end{bmatrix}
    \in \mathcal{M}_{2 \times 3}
    \qquad
    \begin{bmatrix}
        1 & 4 \\
        2 & 5 \\
        3 & 6 \\
    \end{bmatrix}
    \in \mathcal{M}_{3 \times 2}
\end{align*}

\begin{itemize}
    \item Index of componet: the scalar in the i-th row and j-th column is called (i, j)-entry of the matrix. 
    \begin{align*}
        A = 
        \begin{bmatrix}
            a_{11} & \cdots & a_{1n} \\
            \vdots & \ddots & \vdots \\
            a_{m1} & \cdots & a_{mn} \\
        \end{bmatrix}
    \end{align*}
    \item Two matrices with the same size can add or subtract. Matrix can multiply by a scalar.
    \item Zero matrix: matrix with all zero entries, denoted by $O$ or $O_{m \times n}$. 
    \item Identity matrix: must be square
    \begin{itemize}
        \item Diagnoal value is $1$, and others is $0$.
        \item For example: 
        \begin{align*}
            I_3 = 
            \begin{bmatrix}
                1 & 0 & 0 \\
                0 & 1 & 0 \\
                0 & 0 & 1 \\
            \end{bmatrix}
        \end{align*}
    \end{itemize}
\end{itemize}

\subsection{Properties }
\begin{itemize}
    \item A, B, C are $m \times n$ matrices, and $s$ and $t$ are scalars
    \begin{itemize}
        \item $A + B = B + A$
        \item $(A + B) + C = A + (B + C)$
        \item $(st)A = s(tA)$ 
        \item $s(A+B) = sA + sB$
        \item $(s+t)A = sA + tA$
    \end{itemize}
    \item Transpose: If $A$ is an $m \times n$ matrix, $A^T$(transpose of A) is an $n \times m$ matrix whose (i, j)-entry is the (j-i)-entry of A.
    \begin{align*}
        A = 
        \begin{bmatrix}
            6 & 9 \\
            8 & 0 \\
            9 & 2 \\
        \end{bmatrix}
        \quad
        \underrightarrow{Transpose}
        \quad
        A^T = 
        \begin{bmatrix}
            6 & 8 & 9 \\
            9 & 0 & 2 \\
        \end{bmatrix}
    \end{align*}
    \item $A$ and $B$ are $m \times n$ matrices, and $s$ is a scalar
    \begin{itemize}
        \item $(A^T)^T = A$ 
        \item $(sA)^T = sA^T$
        \item $(A + B)^T = A^T + B^T$
    \end{itemize}
\end{itemize}

\section{Matrix-Vector Products}
A matix, $A_{m \times n}$, and a vector $x_n$ can be producted. And there are two aspects to understand the process of producting.
\begin{align*}
    \mathbf{A} = 
    \begin{bmatrix}
        a_{11} & a_{12} & \cdots & a_{1n} \\
        a_{21} & a_{22} & \cdots & a_{2n} \\
        \vdots & \vdots & \ddots & \vdots \\
        a_{m1} & a_{m2} & \cdots & a_{mn} \\
    \end{bmatrix}_{m \times n}
    ,
    \mathbf{x} = 
    \begin{bmatrix}
        x_1 \\
        x_2 \\
        \vdots \\
        x_n \\
    \end{bmatrix}_n
\end{align*}

\begin{itemize}
    \item Rows aspect: we can regrad row as a vector in matrix, $\mathbf{A}$. So the $\mathbf{Ax}$ is equal to every row vector to \textbf{inner product} $\mathbf{x}$ as every entry of reuslt. 
    \begin{align*}
        \mathbf{Ax} = 
        \begin{bmatrix}
            [a_{11}\quad a_{12}\quad \cdots\quad a_{1n}] \times \mathbf{x} \\
            [a_{21}\quad a_{22}\quad \cdots\quad a_{2n}] \times \mathbf{x} \\
            \vdots \\
            [a_{m1}\quad a_{m2}\quad \cdots\quad a_{mn}] \times \mathbf{x} \\
        \end{bmatrix}_m
        =
        \begin{bmatrix}
            a_{11}x_1 + a_{12}x_2 + \cdots  + a_{1n}x_n\\
            a_{21}x_1 + a_{22}x_2 + \cdots  + a_{2n}x_n\\
            \vdots \\
            a_{m1}x_1 + a_{m2}x_2 + \cdots  + a_{mn}x_n\\
        \end{bmatrix}
    \end{align*}
    \item Columns aspect: we can regard column as a vector in matrix, $\mathbf{A}$. So the $\mathbf{Ax}$ means every column vector is be \textbf{transfered} by a component of $\mathbf{x}$ and sum of them.
    \begin{align*}
        \mathbf{Ax} = 
        \begin{bmatrix}
            a_{11} \\
            a_{21} \\
            \vdots \\
            a_{m1} \\
        \end{bmatrix}
        x_1 + 
        \begin{bmatrix}
            a_{12} \\
            a_{22} \\
            \vdots \\
            a_{m2} \\
        \end{bmatrix}
        x_2 +
        \cdots + 
        \begin{bmatrix}
            a_{1n} \\
            a_{2n} \\
            \vdots \\
            a_{mn} \\
        \end{bmatrix}
        x_n
        = 
        \begin{bmatrix}
            a_{11}x_1 + a_{12}x_2 + \cdots  + a_{1n}x_n\\
            a_{21}x_1 + a_{22}x_2 + \cdots  + a_{2n}x_n\\
            \vdots \\
            a_{m1}x_1 + a_{m2}x_2 + \cdots  + a_{mn}x_n\\
        \end{bmatrix}
    \end{align*}

\end{itemize}

The condition, that the size of matrix and vector should be matched, should be persevered when compute matrix-vector product. 
\subsection{Properties of Matrix-vector Product}
\begin{itemize}
    \item $\mathbf{A}$ and $\mathbf{B}$ are $m \times n$ matrices, $\mathbf{u}$ and $\mathbf{v}$ are vectors in $\mathcal{R}^n$, and $c$ is scalar. 
    \begin{itemize}
        \item $\mathbf{A}(\mathbf{u} + \mathbf{v}) = \mathbf{A}\mathbf{u} + \mathbf{A}\mathbf{v}$
        \item $\mathbf{A}(c\mathbf{u}) = c(\mathbf{A}\mathbf{u}) = (c\mathbf{A})\mathbf{u}$
        \item $(\mathbf{A} +\mathbf{B})\mathbf{u} = \mathbf{A}\mathbf{u} + \mathbf{B}\mathbf{u}$
        \item $\mathbf{A0}$ is the $m \times 1$ zero vector
        \item $\mathbf{0v}$ is also the $m \times 1$ zero vector
        \item $ I_n \mathbf{v} = \mathbf{v}$ 
    \end{itemize}
\end{itemize}

\chapter{Does a system of linear equations have solutions?}
\section{Basic Knowledge}
\subsection{Solution}
\begin{itemize}
    \item The set of all solutions of a system of linear equations is called \textbf{solution set}
    \item A system of linear equations is called \textbf{consistent} if it has one or more solutions.
    \item A system of linear equations is called \textbf{inconsistent} if its solution set is empty. 
\end{itemize}

\section{Linear Combination}
Given a vector set $\{u_1, u_2, \cdots, u_k\}$, the \textbf{linear combination} of the vectors in the set: 
\begin{itemize}
    \item $v = c_1u_1 + c_2u_2 + \cdots + c_ku_k$
    \item $c_1, c_2, \cdots, c_k$ are scalars(Coefficients of linear combination)
\end{itemize}
\textbf{Linear combination} have the same understanding as \textbf{column aspect} in Matrix-vector product.

Given a system of linear equations, $\mathbf{Ax} = \mathbf{b}$, we can think the question, ``dose a system of linear equations have solutions?'', as the ``is $b$ the linear combination of columns of $A$?''.

This is example to understand the transfered thoughts. 
If $\mathbf{u}$ and $\mathbf{v}$ are any nonparallel vectors in $\mathcal{R}^2$, then every vector in $\mathcal{R}^2$ is a linear combination of $\mathbf{u}$ and $\mathbf{v}$. 
\begin{itemize}
    \item \textbf{Nonparallel}: $\mathbf{u}$ and $\mathbf{v}$ are nonzero vectors, and $\mathbf{u} \neq c\mathbf{v}$
\end{itemize}
\section{Span}
Given a vector set $S = \{u_1, u_2, \cdots, u_k\}$, \textbf{span} of $S$ is the vector set of all linear combinations of $u_1, u_2, \cdots, u_k$
\begin{itemize}
    \item Denoted by $Span \{u_1, u_2, \cdots, u_k\}$ or $Span\ S$
    \item $Span\ S = \{c_1u_2 + c_2u_2, \cdots, c_ku_k \mid for\ all\ c_1, c_2, \cdots, c_k\}$
    \item Vector set $V = Span\ S$
\end{itemize}
We call ``$S$ is a generating set for $V$'' or ``$S$ generates $V$''. And a vector set generated by another vector set is called \textbf{Space}.

Given a system of linear equations, $\mathbf{Ax} = \mathbf{b}$, we can think the question, ``dose a system of linear equations have solutions?'', as the ``is $\mathbf{b}$ the span of the columns of $\mathbf{A}$?''

\section{Summary}
Now given a system of linear equations, $\mathbf{Ax} = \mathbf{b}$, we can describe if it has solutions by different aspects. 
\begin{enumerate}
    \item  Has solution or not?
    \begin{align*}
        \begin{matrix}
            a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n = b_1\\
            a_{21}x_1 + a_{22}x_2 + \cdots  + a_{2n}x_n = b_2\\
            \vdots \\
            a_{m1}x_1 + a_{m2}x_2 + \cdots  + a_{mn}x_n = b_m\\
        \end{matrix}
    \end{align*}
    \item Is $\mathbf{b}$ the \textbf{linear combination} of columns of $\mathbf{A}$?
    \begin{align*}
        \begin{bmatrix}
            a_{11} \\
            a_{21} \\
            \vdots \\
            a_{m1} \\
        \end{bmatrix}
        x_1 + 
        \begin{bmatrix}
            a_{12} \\
            a_{22} \\
            \vdots \\
            a_{m2} \\
        \end{bmatrix}
        x_2 +
        \cdots + 
        \begin{bmatrix}
            a_{1n} \\
            a_{2n} \\
            \vdots \\
            a_{mn} \\
        \end{bmatrix}
        x_n
        = 
        \begin{bmatrix}
            b_1 \\
            b_2 \\
            \vdots \\
            b_m \\
        \end{bmatrix}
    \end{align*}
    \item Is $\mathbf{b}$ the \textbf{span} of columns of $\mathbf{A}$?
    \begin{align*}
        \begin{bmatrix}
            b_1 \\
            b_2 \\
            \vdots \\
            b_m \\
        \end{bmatrix}
        \in 
        Span\ 
        \left\{
            \begin{bmatrix}
                a_{11} \\
                a_{21} \\
                \vdots \\
                a_{m1} \\
            \end{bmatrix}, 
            \begin{bmatrix}
                a_{12} \\
                a_{22} \\
                \vdots \\
                a_{m2} \\
            \end{bmatrix},
            \cdots,  
            \begin{bmatrix}
                a_{1n} \\
                a_{2n} \\
                \vdots \\
                a_{mn} \\
            \end{bmatrix}
        \right\}
    \end{align*}
\end{enumerate}